// ==================== src/traits/health_checker.rs ====================
//! 健康检查trait

use async_trait::async_trait;
use crate::{Result, ServiceInstance, HealthCheckResult};

/// 健康检查trait
#[async_trait]
pub trait HealthChecker: Send + Sync + std::fmt::Debug {
    /// 检查实例健康状态
    async fn check_health(&self, instance: &ServiceInstance) -> Result<HealthCheckResult>;
    
    /// 批量检查健康状态
    async fn batch_check_health(&self, instances: &[ServiceInstance]) -> Result<Vec<HealthCheckResult>>;
    
    /// 启动健康检查
    async fn start_health_check(&self, instance: &ServiceInstance) -> Result<()>;
    
    /// 停止健康检查
    async fn stop_health_check(&self, instance_id: &str) -> Result<()>;
    
    /// 获取健康检查结果
    async fn get_health_status(&self, instance_id: &str) -> Result<Option<HealthCheckResult>>;
}